package cn.huangsm.advance.redistolimit;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author huang
 * @PACKAGE_NAME cn.huangsm.advance.redistolimit
 * @PROJECT_NAME advance-code
 * @date 2019/1/19
 */
@RestController
public class Test1Controller {

    @GetMapping("/test1")
    @AccessLimit(limit = 1, sec = 2)
    public String test(HttpServletRequest request, @RequestParam(value = "username", required = false) String userName) {        //TODO somethings……
        return "hello world !";
    }
}
